<%@page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="../global/global.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <jsp:include page="../components/htmlHeader.jsp"></jsp:include>
    <title><testU:i18n>questionsPage.title</testU:i18n></title>
    <script language="JavaScript" src="<%=cPath%>/testYou/resources/validations.js">
    </script>
</head>
<body class="bgColor textColor">
<jsp:include page="../components/header.jsp"/>
<% QuestionsPage questionsPage = new QuestionsPage(request,response);%>
<c:set var="questionsPage" value="<%=questionsPage%>"/>
<br><br>

<%if (questionsPage.hasMessage()){ %>
	<center><testU:i18n>${questionsPage.getMessage()}</testU:i18n></center>
<%} %>
<br>

<form action="<%=cPath%><%=response.encodeURL(ManageQuestionServlet.URL)%>" method="post" id="questForm" name="questForm">
    <input type="hidden" value="edit_delete" name="<%=ManageQuestionServlet.OPERATION%>" id="hiddenField">
    <table class="centerTable30marg width40">
        <tbody>
        <tr>
            <td rowspan="3" class="alignCenter padLeft10">
                <tU:selectListComponent validate="true" formName="questForm" editButtonId="editButton" deleteButtonId="deleteButton"/>
            </td>
            <td>
               <c:set var="langID" value="${userPage.user.lang}"/>
                <c:set value="<%=ManageQuestionServlet.OPERATION_EDIT%>" var="editQuest"/>
                <input class="width110" disabled="disabled" type="submit" value='<testU:i18n>questionsPage.edit</testU:i18n>'
                       id="editButton" onclick="operEdit('${editQuest}','questForm');"/>
            </td>
        </tr>
        <tr>
            <td>
                <c:set value="<%=ManageQuestionServlet.OPERATION_DELETE%>" var="delQuest"/>
                <input class="width110" type="submit" value="<testU:i18n>questionsPage.delete</testU:i18n>"
                       id="deleteButton" disabled="disabled" onclick="operDelete('${delQuest}','questForm');"/>
            </td>
        </tr>

        <tr>
            <td>

                <c:set value="<%=ManageQuestionServlet.OPERATION_NEW%>" var="addQue"/>
                <input class="width110" type="submit" value='<testU:i18n>questionsPage.new</testU:i18n>' id="addButton"
                       onclick="operAdd('${addQue}','questForm');"/>
            </td>
        </tr>
        </tbody>
    </table>
</form>

<%if (questionsPage.hasError()){%>
<script type="text/javascript">
    alert('<testU:i18n>${questionsPage.error}</testU:i18n>');
</script>
<%} %>
</body>

</html>